package com.inventive.jmscache.server.utils;

import java.util.Collection;
import java.util.Enumeration;
import java.util.Iterator;

/**
 * Created by IntelliJ IDEA.
 */
public class CollectionEnumeration<E> implements Enumeration<E> {

    Iterator<E> iterator;

    public CollectionEnumeration(Collection<E> collection) {
        iterator = collection.iterator();
    }

    public boolean hasMoreElements() {
        return iterator.hasNext();
    }

    public E nextElement() {
        return iterator.next();
    }
}
